package com.gary.enums;
import java.util.HashMap;
import java.util.Map;

/**
 * 是否是父节点，10不是；20是
 *
 * @author Homan Liang
 * @date 2019/11/1
 */
public enum RuleParentEnum {
    NO(10, "no", "不是"),
    YES(20, "yes", "是");

    //状态码
    private int statusCode;
    //状态英文
    private String statusMsgEn;
    //状态中文
    private String statusMsgCn;

    // Reverse-lookup map for getting a day from an abbreviation
    private static final Map<Integer, RuleParentEnum> lookup = new HashMap<>();

    static {
        for (RuleParentEnum ase : RuleParentEnum.values()) {
            lookup.put(ase.getStatusCode(), ase);
        }
    }

    RuleParentEnum(int statusCode, String statusMsgEn, String statusMsgCn) {
        this.statusCode = statusCode;
        this.statusMsgEn = statusMsgEn;
        this.statusMsgCn = statusMsgCn;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public String getStatusMsgEn() {
        return statusMsgEn;
    }

    public String getStatusMsgCn() {
        return statusMsgCn;
    }

    public static RuleParentEnum get(Integer statusCode) {
        return lookup.get(statusCode);
    }
}
